package com.tc.web;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @Auther: tianchao
 * @Date: 2020/8/23 19:05
 * @Description:
 */
@RestController
public class HelloController {
    @GetMapping("hello")
    public Map<String,String> hello() throws InterruptedException {
        Thread.sleep(100000);
        Map<String,String> map = new HashMap<>();
        map.put("hello", "hello springboot");
        return map;
    }
    @GetMapping("hello2")
    public Map<String,String> hello2() throws InterruptedException {
        Thread.sleep(100);
        Map<String,String> map = new HashMap<>();
        map.put("hello", "hello springboot");
        if (true){
            throw new RuntimeException("出错了");
        }
        return map;
    }

}
